import {getMenuList} from '@/services/api'
// import { getMenuSessionData, getMenuMapArrData } from '@/utils/utils.js'
export default {
  namespace: 'menu',
  state: {
    list: [],
  },

  effects: {
    * fetch({payload}, {call, put}) {
      const response = yield call(getMenuList, payload);
      yield put({
        type: 'save',
        payload: response
      })
    },
    * changeurl({payload}, {call, put}) {
      yield put({
        type: 'change',
        payload: payload
      })
    },
  },

  reducers: {
    save(state, action) {
      return {
        ...state,
        ...action.payload,
      }
    },
    change(state, action) {
      return {
        ...state,
        urlValues: action.payload,
      }
    },
  }
}
